import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document } from 'mongoose';

export type TodoDocument = Todo & Document;

@Schema()
export class Todo {
  @Prop()
  title: string;

  @Prop()
  details: string;

  @Prop()
  status: number;

  @Prop({ default: new Date() })
  created: Date;
}

export const TodoSchema = SchemaFactory.createForClass(Todo);